import javax.annotation.processing.Filer;
import java.io.*;
import java.net.Socket;

public class exam_02_Cilent {
    public static void main(String[] args) {
        try {
            Socket socket=new Socket("127.168.15.78",8888);
            BufferedInputStream bi = new BufferedInputStream(socket.getInputStream());
            File file = new File("D:\\zuoye\\ceshi\\shi.txt");
            FileOutputStream fo = new FileOutputStream(file);
            BufferedOutputStream bo = new BufferedOutputStream(fo);
            byte[] b = new byte[1024];
            int len;
            while ((len = bi.read())!=-1) {
                bo.write(b);
            }
            bo.close();;
            fo.close();
            bi.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
